package com.monitor.system.service.impl;

import java.util.List;
import com.monitor.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.monitor.system.mapper.LinkTopologyMapper;
import com.monitor.system.domain.LinkTopology;
import com.monitor.system.service.ILinkTopologyService;

/**
 * 链路拓扑Service业务层处理
 * 
 * @author monitor
 * @date 2024-06-06
 */
@Service
public class LinkTopologyServiceImpl implements ILinkTopologyService 
{
    @Autowired
    private LinkTopologyMapper linkTopologyMapper;

    /**
     * 查询链路拓扑
     * 
     * @param id 链路拓扑主键
     * @return 链路拓扑
     */
    @Override
    public LinkTopology selectLinkTopologyById(Long id)
    {
        return linkTopologyMapper.selectLinkTopologyById(id);
    }

    /**
     * 查询链路拓扑列表
     * 
     * @param linkTopology 链路拓扑
     * @return 链路拓扑
     */
    @Override
    public List<LinkTopology> selectLinkTopologyList(LinkTopology linkTopology)
    {
        return linkTopologyMapper.selectLinkTopologyList(linkTopology);
    }

    /**
     * 新增链路拓扑
     * 
     * @param linkTopology 链路拓扑
     * @return 结果
     */
    @Override
    public int insertLinkTopology(LinkTopology linkTopology)
    {
        linkTopology.setCreateTime(DateUtils.getNowDate());
        return linkTopologyMapper.insertLinkTopology(linkTopology);
    }

    /**
     * 修改链路拓扑
     * 
     * @param linkTopology 链路拓扑
     * @return 结果
     */
    @Override
    public int updateLinkTopology(LinkTopology linkTopology)
    {
        linkTopology.setUpdateTime(DateUtils.getNowDate());
        return linkTopologyMapper.updateLinkTopology(linkTopology);
    }

    /**
     * 批量删除链路拓扑
     * 
     * @param ids 需要删除的链路拓扑主键
     * @return 结果
     */
    @Override
    public int deleteLinkTopologyByIds(Long[] ids)
    {
        return linkTopologyMapper.deleteLinkTopologyByIds(ids);
    }

    /**
     * 删除链路拓扑信息
     * 
     * @param id 链路拓扑主键
     * @return 结果
     */
    @Override
    public int deleteLinkTopologyById(Long id)
    {
        return linkTopologyMapper.deleteLinkTopologyById(id);
    }
}
